{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import k3d\n",
    "import vtk\n",
    "from k3d.helpers import download\n",
    "import ipywidgets as widgets\n",
    "\n",
    "filename = download('https://github.com/To-Fujita/Babylon.js_3D_Graphics/raw/master/scenes/stl/Cute%20Darth%20Vader.stl')\n",
    "\n",
    "reader = vtk.vtkSTLReader()\n",
    "reader.SetFileName(filename)\n",
    "reader.Update()\n",
    "\n",
    "plot = k3d.plot()\n",
    "\n",
    "mesh1 = k3d.vtk_poly_data(reader.GetOutput(), color=0x222222)\n",
    "mesh1.opacity= 0.5\n",
    "\n",
    "mesh2= k3d.vtk_poly_data(reader.GetOutput(), color=0xaa0000)\n",
    "mesh2.opacity= 0.5\n",
    "mesh2.transform.translation = [40,0,0]\n",
    "\n",
    "plot += mesh1\n",
    "plot += mesh2\n",
    "\n",
    "plot.display()\n",
    "\n",
    "debug_info = widgets.HTML()\n",
    "display(debug_info)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot.camera = [36.7343028298735,\n",
    " 166.93825876342206,\n",
    " 183.97018487960082,\n",
    " 53.44,\n",
    " 93.47,\n",
    " 46.74,\n",
    " -0.15414520314362307,\n",
    " 0.8835669426809623,\n",
    " -0.44220890329032814]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plot.depth_peels = 7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  },
  "nbTranslate": {
   "displayLangs": [
    "en",
    "pl"
   ],
   "hotkey": "alt-t",
   "langInMainMenu": true,
   "sourceLang": "pl",
   "targetLang": "en",
   "useGoogleTranslate": true
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
